package listmapdemo;

public class product implements Comparable<product>{
    public int id;
    public String name;
    public double price;
    public double category;
    @Override
    public int compareTo(product o) {
        if(this.price>o.price)
            return 1;
        else if(this.price<o.price)
            return -1;
        else  return 0;
    }
}
